<template>
  <div class="empty-container">
    <div class="empty-content">
      <div class="empty-icon">
        <slot name="icon">
          <el-icon :size="64" color="var(--el-text-color-placeholder)">
            <Files />
          </el-icon>
        </slot>
      </div>
      <div class="empty-text">
        <slot name="text">
          <span>暂无数据</span>
        </slot>
      </div>
      <div v-if="$slots.action" class="empty-action">
        <slot name="action"></slot>
      </div>
    </div>
  </div>
</template>

<script setup>
import { Files } from '@element-plus/icons-vue'
</script>

<style lang="scss" scoped>
.empty-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 200px;
  padding: 20px;
  
  .empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    .empty-icon {
      margin-bottom: 16px;
    }
    
    .empty-text {
      color: var(--el-text-color-placeholder);
      font-size: var(--el-font-size-base);
      margin-bottom: 16px;
    }
    
    .empty-action {
      margin-top: 16px;
    }
  }
}
</style>